﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script src="~/Content/js/ueditor/ueditor.config.js"  charset="utf-8" type="text/javascript" ></script>
<script src="~/Content/js/ueditor/ueditor.all.min.js"  charset="utf-8" type="text/javascript" ></script>
<script type="text/javascript" charset="utf-8" src="~/Content/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    var keyValue = $.request("keyValue");
    var ue = UE.getEditor('editor');
    $(function () {
        if (!!keyValue) {
            $.ajax({
                url: "/BusinessManage/D_NewsList/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                    //$("#hid_content").val(data.F_Content);
                    //UE.getEditor('editor').setContent($("#hid_content")[0].innerHTML,true);
                    //alert(data.F_Content.InnerHtml);
                }
            });
        }
    });
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }

        var data=$("#form1").formSerialize();
        //data.F_Content=escape(UE.getEditor('editor').getContent());
        $.submitForm({
            url: "/BusinessManage/D_NewsList/SubmitForm?keyValue=" + keyValue,
            param: data,
            success: function () {
                $.currentWindow().$("#gridList").resetSelection();
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        })
    }
</script>

<form id="form1">
    <div style="padding-top: 20px; margin-right: 20px;">
        
        <table class="form">
            <tr>
                <th class="formTitle">标题</th>
                <td class="formValue" colspan="3">
                    <input id="F_Title" name="F_Title" type="text" class="form-control required" placeholder="请输入标题" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">简述</th>
                <td class="formValue" colspan="3">
                    <input id="F_Sketch" name="F_Sketch" type="text" class="form-control required" placeholder="请输入简述" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">内容</th>
                <td class="formValue" colspan="3">
                    <textarea id="F_Content" name="F_Content" class="form-control" style="height:170px;" placeholder="请输入内容" />
                    @*<script id="editor" type="text/plain" style="width:420px;height:170px;">
    </script>
    <input type="hidden" id="hid_content" />*@
                </td>
            </tr>
        </table>
    </div>
</form>
